package com.budwk.app.sqfwV2.enums;

import lombok.Getter;

/**
 * @author zhangp
 * @description TODO
 * @className CheckTimeoutEnum
 * @Date 9:11 2024/7/31
 */
@Getter
public enum CheckTimeoutEnum {
    DAY("day", "天"),
    MONTH("month", "月"),
    YEAR("year", "年"),
    ;

    private final String code;
    private final String name;

    CheckTimeoutEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static boolean verification(String code) {
        for (CheckTimeoutEnum ct : CheckTimeoutEnum.values()) {
            if (ct.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
